{extend name="public/base"}

{block name="main"}
<form action="{:url('/user')}" class="pb-3">
  <div class="form-row">
    <div class="col-form-label">
      <label for="username">借用人：</label>
    </div>
    <div class="col-2">
      <input type="text" id="username" name="username" placeholder="查询的借用人" class="form-control">
    </div>
    <div class="col-form-label">
      <label for="email">邮箱：</label>
    </div>
    <div class="col-2">
      <input type="text" id="email" name="email" placeholder="查询的邮箱" class="form-control">
    </div>
    <div class="col-form-label">
      <label for="gender">性别：</label>
    </div>
    <div class="col-auto">
      <select name="gender" id="gender" class="custom-select">
        <option selected value="">选择性别：</option>
        <option value="男">男</option>
        <option value="女">女</option>
      </select>
    </div>
    <div class="col-auto">
      <button class="btn btn-primary">搜索</button>
      <a href="{:url('/user/create')}" class="btn btn-success">添加用户</a>
    </div>
  </div>
</form>

<!--列表-->
<table class="table table-bordered">
  <thead class="thead-light">
  <tr>
    <th class="text-center">ID</th>
    <th>借用人</th>
    <th class="text-center">性别</th>
    <th>邮箱</th>
    <th class="text-center">状态</th>
    <th class="text-center {$orderTime == 'desc' ? '' : 'dropup'}">
      <a href="{:app\\common\\Tool::url('create_time')}create_time={$orderTime}" class="text-secondary text-decoration-none dropdown-toggle">设备借出时间</a>
    </th>
    <th class=>部门</th>
    <th class=>电话</th>
    <th class="text-center">操作</th>
  </tr>
  </thead>
  <tbody>
  {assign name="empty" value='<tr><td colspan="7" class="text-center text-muted">没有数据</td></tr>'}
  {volist name="list" id="obj" empty="$empty"}
  <tr>
    <td class="text-center">{$obj.id}</td>
    <td >{$obj.username}</td>
    <td class="text-center">{$obj.gender}</td>
    <td>{$obj.email}</td>
    <td class="text-center">
      <span class="badge btn-{$obj.badge}">{$obj.status}</span>
    </td>
    <td class="text-center">{$obj.create_time}</td>
    <td >{$obj.group}</td>
    <td class="text-center">{$obj.phone}</td>
    <td >
      <form action="{:url('/user/'.$obj.id)}" method="post">
        <input type="hidden" name="_method" value="delete">
        <button class="btn btn-danger btn-sm btn-delete">删除</button>
        <a href="{:url('/user/'.$obj.id.'/edit')}" class="btn btn-warning btn-sm">修改</a>
      </form>
    </td>
  </tr>
  {/volist}
  </tbody>
</table>

<!--分页-->
{$list|raw}
{/block}